package com.wander.designCreational.prototype;

import org.junit.jupiter.api.Test;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author : WDYin
 * @Date : 2020/5/9
 * @Description :
 */
public class Client {
    @Test
    public void test() throws CloneNotSupportedException {
        Map<String, Double> map = new HashMap<>();
        map.put("数学", 100D);
        Prototype prototype = new Prototype(1, "小明", map);

        Prototype prototype1 = prototype.clone();
        Map<String, Double> map1 = prototype1.getMap();
        map1.put("数学", 99d);

        System.out.println(prototype);
        System.out.println(prototype1);
    }
}
